using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_SourceList : Admin, IRequiresSessionState
{
	protected TextBox UserList;
	protected TextBox KeyWord;
	protected Button SearchBtn;
	protected DataList showuserlist;
	protected Label PagePanel;
	protected HtmlForm userform;
	public int m_pageSize = 40;
	public string m_where = "";
	public string linkhead = "";
	public string m_KeyWord = "";
	private UserBll _user;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected UserBll m_User
	{
		get
		{
			UserBll user;
			if (this._user == null)
			{
				this._user = new UserBll(this.conn);
				user = this._user;
			}
			else
			{
				user = this._user;
			}
			return user;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			this.UserList.Text = Fetch.Get("DefaultValue");
			this.BandPage();
		}
	}
	protected void BandPage()
	{
		int num = Fetch.GetID("page");
		if (num <= 0)
		{
			num = 1;
		}
		this.QuestString();
		this.showuserlist.DataSource = this.m_User.GetAllUsersOnPage(num, this.m_where, "", this.m_pageSize);
		this.showuserlist.DataBind();
		this.PagePanel.Text = this.m_User.ShowPagePanelJs(false);
	}
	protected void QuestString()
	{
		this.m_KeyWord = Fetch.Get("keyname");
		if (this.m_KeyWord != string.Empty)
		{
			this.KeyWord.Text = this.m_KeyWord;
		}
		else
		{
			this.m_KeyWord = this.KeyWord.Text;
		}
		if (this.m_KeyWord != "")
		{
			this.m_where = "Where UserName like '%" + base.Server.HtmlEncode(this.m_KeyWord) + "%'";
			this.linkhead = "&keyname=" + base.Server.HtmlEncode(this.m_KeyWord);
		}
	}
	protected void SearchBtn_Click(object sender, EventArgs e)
	{
		this.BandPage();
	}
}
